package socket.chat;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerOut {

	public static void main(String[] args) throws IOException {
		//1.创建服务端+端口
		ServerSocket server = new ServerSocket(8888);  
		Socket socket = server.accept();
		DataInputStream dis = new DataInputStream(socket.getInputStream());
		String msg = dis.readUTF();
		System.out.println(msg);
		DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
	    dos.writeUTF(msg);
	}

}
